type = int(input("请选择贷款类型：1.商业贷款 2.公积金贷款 3.组合贷款"))
borrow = int(input("请输入贷款金额(万元)"))
years = int(input("请输入贷款年数(年):"))

if years>5:
    if type == 1:
        r = 4.90/100
    elif type == 2:
        r = 3.25/100
 
elif 0<years<=5:
    if type == 1:
        r = 4.75/100
    elif type == 2:
        r = 2.75/100
else:
    print('输入错误')
    
borrow1 = borrow * 10000
monthR = r/12           #月利率
month = 12*years        #贷款总月数
monthliXi = monthR*borrow1    #月利息
 
eachMonth = borrow1 * monthR * pow(1 + monthR, month) /(pow((1 + monthR),month)-1) #每月月供参考
allMoney = eachMonth * years * 12  #还款总额
liXi = allMoney - borrow1
print('您的每月月供参考为：',eachMonth,"元")
print('您的还款总额为：',allMoney,"元")
print('您需还的利息为：',liXi,"元")